package belf.migrate.api.common;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Properties2Json {
    @Test
    public void testConvert() throws IOException {
        Properties properties = new Properties();
        properties.load(new FileInputStream(new File("c:/tmp/debezium-oracle.properties")));
        System.out.println(properties);

        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(properties);
        System.out.println(json);
    }
}
